#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>

#define MAX_LEN 80

int main() {
	int alphabet[26] = { 0 };
	char ch;
	int index = 0;
	bool same_flag = false;

	printf("Enter first word: ");
	while ((ch = getchar()) != '\n' && index < MAX_LEN)
	{
		if (isalpha(ch))
		{
			alphabet[toupper(ch) - 'A'] += 1;
		}
	}

	printf("Enter second word: ");
	while ((ch = getchar()) != '\n' && index < MAX_LEN)
	{
		if (isalpha(ch))
		{
			alphabet[toupper(ch) - 'A'] -= 1;
		}
	}

	printf("The words are ");

	for (int i = 0; i < 26; i++)
	{
		if (alphabet[i]) same_flag = true;
	}
	if (same_flag) printf("not ");

	printf("anagrams.\n");


	return 0;
}